/**
 * 更新选中状态
 * @param oldList 旧的选中列表
 * @param newList 新选中的列表
 */
export const updateSelection = function (oldList: SelectionData[], newList: SelectionData[]): void {
    let len1: number = oldList ? oldList.length : 0;
    let len2: number = newList ? newList.length : 0;
    let i: number = 0;
    let item: SelectionData;
    if (len1 > len2) {
        // 减少选中操作
        for (i = len1 - 1; i >= 0; i--) {
            item = oldList[i];
            if (newList.indexOf(item) === -1) {
                item.selected = false;
                oldList.splice(i, 1);
            }
        }
    } else if (len2 > len1) {
        //增加选中操作
        for (i = len2 - 1; i >= 0; i--) {
            item = newList[i];
            if (oldList.indexOf(item) === -1) {
                item.selected = true;
                oldList.push(item);
            }
        }
    }
}

export const getQueryData = function (main: QueryField, advs: QueryField[]): any {

}